package com.sheng.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.ArrayList;
import java.util.List;

@Controller
public class BookController {

    @GetMapping("/viewBooks")
    public String viewBooks(Model model){
        List<String> bookList = new ArrayList<>();
        bookList.add("图书1");
        bookList.add("图书2");
        bookList.add("图书3");
        bookList.add("图书4");
        bookList.add("图书5");
        model.addAttribute("books",bookList);
        return "books";
    }

}
